//@ sourceURL=RiskFactorsForm.js
RiskFactorsForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        RiskFactorsForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/health/saveRiskFactors.do",
                items:[
                {
                    id : "riskFactors.id",
                    name : "riskFactors.id",
                    xtype : "hidden",
                    value : this.id == null ? "": this.id
                }, {
                    name : "riskFactors.years",
                    xtype : "hidden",
                    id : "riskFactors.years",
                    value : this.years == null ? "" : this.years
                },{
                    layout:"column",
                    bodyStyle:"padding:5px;",
                    items:[{
                        layout:"form",
                        bodyStyle:"padding:5px;",
                        defaultType:"textfield",
                        border:false,
                        columnWidth:0.5,
                        items:[{
                            fieldLabel: '所属机构', 
                            name: 'riskFactors.institution'
                            
                        }]
                },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '因素名称'+'<font color=red>*</font>', 
                       name: 'riskFactors.factorName',
                       allowBlank:false,
                       blankText:"因素名称不能为空！"
                       
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '涉及部门', 
                       name: 'riskFactors.involveDept'
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '涉及岗位', 
                       name: 'riskFactors.involvePost'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '风险等级', 
                       name: 'riskFactors.riskLevel'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       defaultType:"textfield",
                       items:[{
                       fieldLabel: '涉及的人员或岗位', 
                       name: 'riskFactors.involvePerson', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       defaultType:"textfield",
                       items:[{
                       fieldLabel: '涉及的作业或业务', 
                       name: 'riskFactors.involveTask', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '出现原因', 
                       name: 'riskFactors.reason', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '涉及位置或场所', 
                       name: 'riskFactors.involvePosition', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '控制措施', 
                       name: 'riskFactors.controlMeasures', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '应急处置', 
                       name: 'riskFactors.emergency', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea", 
                       fieldLabel: '备注', 
                       name: 'riskFactors.remark',
                       width : 448 
                       
                       }]
                   }]
               }
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/health/getRiskFactors.do",
                preName : "riskFactors"
            },
            isShow:this.isShow
        });
    }
});
